<?php

// +----------------------------------------------------------------------
// | 支付&转账设置
// +----------------------------------------------------------------------

use app\index\service\payments\AccountPaymentService;
use app\index\service\payments\CardPaymentService;
use app\index\service\payments\CoinPaymentService;
use app\index\service\payments\MarginPaymentService;
use app\index\service\payments\TtpayPaymentService;
use app\index\service\payments\WxpayPaymentService;

// 支付方式类型
const PAYMENT_WXPAY = 'wxpay';
const PAYMENT_TTPAY = 'ttpay';
const PAYMENT_ACCOUNT = 'account';
const PAYMENT_CARD = 'card';
const PAYMENT_COIN = 'coin';
const PAYMENT_OFFLINE = 'offline';
const PAYMENT_MARGIN = 'margin';

// 微信支付场景
const PAYMENT_WXPAY_JSAPI = 'wxpayjsapi';
const PAYMENT_WXPAY_H5 = 'wxpayh5';


// 转账方式类型
const TRANSFER_WXPAY = PAYMENT_WXPAY;
// const TRANSFER_TTPAY = PAYMENT_TTPAY; // 抖音不能转账
const TRANSFER_ACCOUNT = PAYMENT_ACCOUNT;
const TRANSFER_CARD = PAYMENT_CARD;
const TRANSFER_COIN = PAYMENT_COIN;
const TRANSFER_OFFLINE = PAYMENT_OFFLINE;
const TRANSFER_MARGIN = PAYMENT_MARGIN;

return [

    // 支付方式类型，需要实现 PaymentInterface 接口
    'payments' => [
        PAYMENT_WXPAY => [
            'name' => '微信支付',
            'className' => WxpayPaymentService::class,
        ],
        PAYMENT_TTPAY => [
            'name' => '抖音支付',
            'className' => TtpayPaymentService::class,
        ],
        PAYMENT_ACCOUNT => [
            'name' => '余额',
            'className' => AccountPaymentService::class,
        ],
        PAYMENT_CARD => [
            'name' => '获客卡',
            'className' => CardPaymentService::class,
        ],
        PAYMENT_COIN => [
            'name' => '通信币',
            'className' => CoinPaymentService::class,
        ],
        PAYMENT_OFFLINE => [
            'name' => '对公转账',
        ],
        TRANSFER_MARGIN => [
            'name' => '保证金',
            'className' => MarginPaymentService::class,
        ],
    ],

    // 单笔转账方式类型，需要实现 TransferInterface 接口
    'transfers' => [
        TRANSFER_ACCOUNT => [
            'name' => '余额',
            'className' => AccountPaymentService::class,
        ],
        TRANSFER_CARD => [
            'name' => '获客卡',
            'className' => CardPaymentService::class,
        ],
        TRANSFER_COIN => [
            'name' => '通信币',
            'className' => CoinPaymentService::class,
        ],
        TRANSFER_OFFLINE => [
            'name' => '对公转账',
        ],
        TRANSFER_MARGIN => [
            'name' => '保证金',
            'className' => MarginPaymentService::class,
        ],
    ],

    // 批量转账方式类型 需要实现 TransfersInterface 接口
    'transfersbatch' => [
        TRANSFER_WXPAY => [
            'name' => '微信支付',
            'className' => WxpayPaymentService::class,
            // 单次请求最大笔数
            'max' => 3000,
            // 每个用户每天最大转账限额
            'dayMoney' => 1000,
        ],
    ],
];
